package com.dongdongshop.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.redis.core.index.Indexed;

import java.io.Serializable;
import java.util.Date;

@Document(collection = "comment")//映射mongodb数据库的comment表
public class Comment implements Serializable {


    // @Field映射字段
    // @Indexed增加索引
    @Id
    private String id;//主键ID
    private String userId;//用户名
    private String content;//评论内容
    private Date createTime;//创建时间
    private String itemId;//商品id
    private String img;//买家秀图片
    private String level; //1.极差 2.差 3.一般 4.好 5.非常好

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Comment(String id, String userId, String content, Date createTime, String itemId, String img, String level) {
        this.id = id;
        this.userId = userId;
        this.content = content;
        this.createTime = createTime;
        this.itemId = itemId;
        this.img = img;
        this.level = level;
    }

    public Comment() {
    }
}
